using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace WcfService1.DTO
{
    [DataContract]
    public class InventoryAdjustmentDetailDTO : INotifyPropertyChanged
    {
        private InventoryDTO _Inventory;
        private Int32 _InventoryAdjustmentDetailId;
        private int _No;
        private ObservableCollection<PalletDTO> _Pallets;
        private Decimal _Price;
        private WarehouseDTO _Warehouse;
        private string _itemName;
        private ObservableCollection<ItemDTO> _items;
        private decimal _QtyUnit;
        private decimal _Tinggi;
        private decimal _Panjang;
        private decimal _Lebar;
        private ObservableCollection<WarehouseDTO> _Warehouses;

        public InventoryAdjustmentDetailDTO()
        {
            Inventory = new InventoryDTO();
        }

        [DataMember]
        public Int32 InventoryAdjustmentDetailId
        {
            get { return _InventoryAdjustmentDetailId; }
            set
            {
                _InventoryAdjustmentDetailId = value;
                RaisePropertyChanged("InventoryAdjustmentDetailId");
            }
        }


        [DataMember]
        public InventoryDTO Inventory
        {
            get { return _Inventory; }
            set
            {
                _Inventory = value;
                RaisePropertyChanged("Inventory");
            }
        }

        public string NoAdj { get; set; }

        public String ItemName
        {
            get { return _itemName; }
            set
            {
                _itemName = value;
                RaisePropertyChanged("ItemName");
            }
        }

        public ObservableCollection<ItemDTO> Items
        {
            get { return _items; }
            set
            {
                _items = value;
                RaisePropertyChanged("Items");
            }
        }

        public ObservableCollection<PalletDTO> Pallets
        {
            get { return _Pallets; }
            set
            {
                _Pallets = value;
                RaisePropertyChanged("Pallets");
            }
        }

        [DataMember]
        public WarehouseDTO Warehouse
        {
            get { return _Warehouse; }
            set
            {
                _Warehouse = value;
                RaisePropertyChanged("Warehouse");
            }
        }

        [DataMember]
        public Decimal Price
        {
            get { return _Price; }
            set
            {
                _Price = value;
                RaisePropertyChanged("Price");
            }
        }


        [DataMember]
        public Decimal Panjang
        {
            get { return _Panjang; }
            set
            {
                _Panjang = value;
                RaisePropertyChanged("Panjang");
            }
        }

        [DataMember]
        public Decimal Lebar
        {
            get { return _Lebar; }
            set
            {
                _Lebar = value;
                RaisePropertyChanged("Lebar");
            }
        }

        [DataMember]
        public Decimal Tinggi
        {
            get { return _Tinggi; }
            set
            {
                _Tinggi = value;
                RaisePropertyChanged("Tinggi");
            }
        }

        [DataMember]
        public Decimal QtyUnit
        {
            get { return _QtyUnit; }
            set
            {
                _QtyUnit = value;
                RaisePropertyChanged("QtyUnit");
            }
        }
        public int No
        {
            get { return _No; }
            set
            {
                _No = value;
                RaisePropertyChanged("No");
            }
        }

        public ObservableCollection<WarehouseDTO> Warehouses
        {
            get { return _Warehouses; }
            set
            {
                if (ReferenceEquals(_Warehouses, value) || value == null) return;
                _Warehouses = value;
                RaisePropertyChanged("Warehouses");
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void RaisePropertyChanged(string propertyname)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyname));
        }
    }
}